
#ifndef _TTG_SERVICES_SCHEDULING_ALGORITHM_
#define _TTG_SERVICES_SCHEDULING_ALGORITHM_
#include "Common/Definitions.h"

#include <vector>
#include "Common/Structures.h"
#include "WiseTask.h"
#include "DeviceState.h"

namespace ttg_internal
{
	namespace services
	{
		//Interface of scheduling logic.
		//Note: this class should NOT use lockers. It will be provided by high level.
		class SchedulingAlgorithm
		{
			public:
				//Splits "tasks" into root and child tasks.
				//Child tasks will be performed by the same performer.
				//Root tasks will be sent to task scheduler.
				virtual void split(std::vector<ttg::services::WiseTask *> &tasks,
								   std::vector<ttg::services::WiseTask *> &root_tasks,
								   std::vector<ttg::services::WiseTask *> &child_tasks) = 0;
				//Adds set of task to collection.
				virtual void addTasks(ttg::structures::Enumerator<ttg::threads::Task *> &tasks) = 0;
				//Adds set of wise tasks to collection.
				virtual void addTasks(ttg::structures::Enumerator<ttg::services::WiseTask *> &tasks) = 0;
				//Returns corresponded task for performing.
				virtual ttg::threads::Task *getTask() = 0;
				//Sets ratio
				virtual void setDeviceUsage(ttg::devices::LogicalDevice dt, double ratio) {}
		};
	}
}

#endif
